package com.blyat.xsoft.kernel.restful.pagination;


import com.blyat.xsoft.kernel.restful.entity.BaseEntity;

import java.util.List;

/**
 * @author syh
 * @date 2019/8/26
 **/
public class PageList<T extends BaseEntity> {

    /**
     * 当前是第几页
     **/
    private Integer page;

    /**
     * 当前页的个数
     **/
    private Integer pageSize;

    /**
     * 总数量
     **/
    private Integer total;

    /**
     * 数据
     **/
    private List<T> rows;

    public PageList(Integer page, Integer pageSize, Integer total, List<T> rows) {
        this.page = page;
        this.pageSize = pageSize;
        this.total = total;
        this.rows = rows;
    }

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public List<T> getRows() {
        return rows;
    }

    public void setRows(List<T> rows) {
        this.rows = rows;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    @Override
    public String toString() {
        return "PageList{" +
                "page=" + page +
                ", pageSize=" + pageSize +
                ", total=" + total +
                ", rows=" + rows +
                '}';
    }
}
